<template>

  <div class="flip">
<!--    style="background-image: url(https://images.unsplash.com/photo-1545153987-c456e97455c9?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80)"-->
    <div class="front">
      <h1>{{ info.name }}</h1>
      <div class="title">监控户数</div>
      <div>{{ info.content }}</div>
    </div>
    <div class="back">
<!--      TODO 时间紧迫 这里不进行设计-->
      <h2>Angular</h2>
      <p>Good tools make application development quicker and easier to maintain than if you did everything by hand..</p>
    </div>
  </div>
<!--  <div class="dorm-block-wrapper">-->
<!--    <div class="name">{{ info.name }}</div>-->

<!--  </div>-->
</template>

<script>
export default {
  name: "dorm-block",
  props: {
    info: Object
  }
};
</script>

<style scoped>
.dorm-block-wrapper {
  box-sizing: border-box;
  padding: 30px 30px;
  width: 75%;
  height: 180px;
  display: block;
  /*margin: 30px 0;*/

  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0, 0.15);

  text-align: center;
}

.name {
  /*font-size: 21px;*/
  letter-spacing: 0.02rem;
}

.title {
  font-size: 17px;
}

/*========================================*/

* {
  box-sizing: border-box;
  font-weight: normal;
}
body {
  /*color: #555;*/
  /*background: #222;*/
  /*text-align: center;*/
  /*font-family: 'Roboto Mono';*/
  /*padding: 1em;*/
}
h1 {
  font-size: 2.2em;
}

.flip > .front, .flip > .back {
  display: block;
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition-duration: 0.5s;
  transition-property: transform, opacity;
}
.flip > .front {
  transform: rotateY(0deg);
}
.flip > .back {
  position: absolute;
  opacity: 0;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  transform: rotateY(-180deg);
  margin-left: 17px;
}
.flip:hover > .front {
  transform: rotateY(180deg);
}
.flip:hover > .back {
  opacity: 1;
  transform: rotateY(0deg);
}
.flip.flip-vertical > .back {
  transform: rotateX(-180deg);
}
.flip.flip-vertical:hover > .front {
  transform: rotateX(180deg);
}
.flip.flip-vertical:hover > .back {
  transform: rotateX(0deg);
}
.flip {

  position: relative;
  /*display: inline-block;*/
  display: flex;
  justify-content: center;
  margin: 20px 0;
  width: 90%;
  text-align: center;
  /*margin-right: 2px;*/
  /*margin-bottom: 1em;*/
  /*width: 400px;*/
}
.flip > .front, .flip > .back {
  display: block;
  color: white;
  width: inherit;
  background-size: cover !important;
  background-position: center !important;
  height: 220px;
  padding: 1em 2em;
  background: #000852;
  box-shadow: 0 0 10px #2f34f1 inset;
  border-radius: 10px;
}
.flip > .front p, .flip > .back p {
  font-size: 0.9125rem;
  line-height: 160%;
  color: #999;
}


</style>